/**
 * Created by chenxiaozhong on 2016年1月5日16:51:26.
 */
define(["app",
    "controllers/conference/ShowDetailController"
], function (app) {

    var deps = ["$modal","$window","$state"];

    function showDetail($modal,$window,$state) {
        return {
            scope : {
            	type : "@",
            	id1 :"@",
            	id2:"@"
            },
            link: function ($scope, elem) {
                elem.on("click", function () {
                    var modalInstance = $modal.open({
                        templateUrl: 'views/conference/ShowDetail.html',
                        controller: "ShowDetailController",
                        backdrop : "static",
                        keyboard: false,
                        resolve : {
                        	conferenceId : function() {
                                return $scope.id1;
                            },
                            bookId : function(){
                                return $scope.id2;
                            },
                            conferenceType : function(){
                                return $scope.type;
                            }
                        },
                        windowClass : "conpany-add-modal"
                    });

                    modalInstance.result.then(function(data) {
                    	/*$scope.choseCompany = [];
                    	if(data!=null){
                    		$scope.choseCompany.push(data);
                    		if($scope.onSelect) {
                                $scope.onSelect({$choseCompany:$scope.choseCompany});
                            }
                    	}*/
                    	//$state.go("home.financialManagement");
                    });
                });
            }
            
            
        };
        
    }
    showDetail.$inject = deps;
    return app.lazy.directive("fcShowDetail", showDetail);
});